const { connection } = require('../../../model/database')
module.exports = (req, res) => {
    var sql = `update article set title = '${req.body.title}' , content = '${req.body.content}', author = '${req.body.author}' , date = '${req.body.date}' , class='${req.body.class}' where id = ${req.body.id};`
    connection.query(sql, (error, reslut) => {
        if (error) {
            res.status(400).send({
                message: '修改失败',
            })   
            return
        }
        res.status(200).send({
            message: '修改成功',
        })
    }) 

}